package com.grao.waterschool.human.controller;

import cn.dev33.satoken.util.SaResult;
import com.grao.waterschool.human.entiry.dto.FileBase64;
import com.grao.waterschool.human.manager.service.FileUploadService;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/file/")
@RestController
public class FileUploadController {

    private final FileUploadService fileUploadService;

    public FileUploadController(FileUploadService fileUploadService) {
        this.fileUploadService = fileUploadService;
    }

    @PostMapping("upload")
    public SaResult uploadFiles(@RequestBody FileBase64 fileBase64) throws Exception {
        return fileUploadService.uploadFiles(fileBase64.getFileBase64());
    }

}
